#if defined(_MSC_VER)
#pragma once
#endif

#ifndef LM_LIGHT_POINTLIHGT_H
#define LM_LIGHT_POINTLIHGT_H

#include "../core/light.h"

class PointLight : public Light {
public:
	PointLight(const Transform *l2w, const Transform *w2l, Spectrum intensity);
	bool IsDeltaLight() const { return true; }
	Spectrum Power(const Scene *) { return intensity * 4.f * M_PI; }
	Spectrum Sample_L(const Point3 &p, Vector3 *wi, VisibilityTester *vis) const;
	Spectrum Sample_L(const Point3 &p, const Point2 &sample, Vector3 *wi, float *pdf, VisibilityTester *vis) const;
	float Pdf(const Point3 &p, const Vector3 &wi) const;
	Spectrum Sample_L(const Scene *scene, const Point2 &lightsample, const Point2 &dirsample, Ray *ray, float *pdf) const;
private:
	Point3 lightPos;	// (0,0,0) in light space
	Spectrum intensity;
};

#endif	// LM_LIGHT_POINTLIHGT_H